using System;

namespace JanusLibAing.EventsArg
{
    public class ErrorEventArgs : ExceptionEventArgs
    {
        private readonly ESeverity severity;

        public enum ESeverity
        {
            /// <summary>
            /// After this error execution is not more possible
            /// </summary>
            FatalError,

            /// <summary>
            /// It is execution error but we could try to repeat operation again
            /// </summary>
            Error,

            /// <summary>
            /// Something wrong happends but we can ignore it and work
            /// </summary>
            Warning,

            /// <summary>
            /// Nothing wrong happends - it is only info text
            /// </summary>
            Info,
        }
        //public ErrorEventArgs(string description, Severity severity) 
        //	: base(description)
        //{
        //	this.severity = severity;
        //}

        public ErrorEventArgs(Enum id, ESeverity severity)
            : base(null, id)
        {
            this.severity = severity;
        }

        public ErrorEventArgs(Enum id, string description, ESeverity severity)
            : base(null, id, description)
        {
            this.severity = severity;
        }

        public ErrorEventArgs(System.Exception exception, ESeverity severity)
            : base(exception, default(Enum))
        {
            this.severity = severity;
        }

        public ErrorEventArgs(System.Exception exception, Enum id, ESeverity severity)
            : base(exception, id)
        {
            this.severity = severity;
        }

        public ErrorEventArgs(System.Exception exception, Enum id, string description, ESeverity severity)
            : base(exception, id, description)
        {
            this.severity = severity;
        }


        public ESeverity ErrorLevel
        {
            get
            {
                return severity;
            }
        }
    }
}